package dborm

import "time"

//Tagstable struct
//LDI:01 功能码
//HDI:02 功能码
//LAI:03 功能码
//HAI:04 功能码
//SDO:05 功能码
//SAO:06 功能码
//MDO:15 功能码
//MAO:16 功能码
type Tagstable struct {
	TagName            string    `xorm:"not null pk INTEGER 'tag_name'"`                     // TEXT NOT NULL,
	IODevice           string    `xorm:"index not null TEXT 'io_device'"`                    //TEXT,
	LogicEquipment     string    `xorm:"index not null TEXT 'logic_equipment'"`              //TEXT,
	DataType           int       `xorm:"not null default 1 INTEGER 'data_type'"`             //INTEGER,
	Rate               float64   `xorm:"default 1 REAL 'rate'"`                              //REAL,
	Unit               string    `xorm:"TEXT 'unit'"`                                        //TEXT,
	Reg                string    `xorm:"TEXT 'reg'"`                                         //TEXT,
	HighLimit          float64   `xorm:"REAL 'high_limit'"`                                  //REAL,
	HighHighLimit      float64   `xorm:"REAL 'high_high_limit'"`                             //REAL,
	LowLimit           float64   `xorm:"REAL 'low_limit'"`                                   //REAL,
	LowLowLimit        float64   `xorm:"REAL 'low_low_limit'"`                               //REAL,
	HighAlarmLevel     int       `xorm:"not null default 0 INTEGER 'high_alarm_level'"`      //INTEGER,
	HighHighAlarmLevel int       `xorm:"not null default 0 INTEGER 'high_high_alarm_level'"` //INTEGER,
	LowAlarmLevel      int       `xorm:"not null default 0 INTEGER 'low_alarm_level'"`       //INTEGER,
	LowLowAlarmLevel   int       `xorm:"not null default 0 INTEGER 'low_low_alarm_level'"`   //INTEGER,
	ChangeAlarmLevel   int       `xorm:"not null default 0 INTEGER 'change_alarm_level'"`    //INTEGER,
	IsZeroAlarmLevel   int       `xorm:"not null default 0 INTEGER 'is_zero_alarm_level'"`   //INTEGER,
	NotZeroAlarmLevel  int       `xorm:"not null default 0 INTEGER 'not_zero_alarm_level'"`  //INTEGER
	CreatedAt          time.Time `xorm:"created"`
	UpdatedAt          time.Time `xorm:"updated"`
	DeletedAt          time.Time `xorm:"deleted"`
}
